package StudyCode.summary.mycollection;

/**
 * 版权所有 科技与人文(www.tah1986.com)
 */
public class ComputeTheMeanOfDoubleArray {
	public static void main(String[] args) {
		double[] v = new double[]{34.45, 35.45, 36.67, 37.78, 37.0000,
				37.1234, 67.2344, 68.34534, 69.87700};
		System.out.println("平均值是:" + mean(v));
	}

	public static double mean(double[] series) {
		double res = 0D;
		for (int i = 0; i < series.length; i++) {
			res += series[i];
		}
		return res / ((Integer) series.length).doubleValue();
	}
}
